package edu.intprog.mail;

/**
 * ActivationMailer
 * 
 * This class is used for sending the activation email for new users
 * in order to verify the email address.
 * The sent email will contain a link for activation
 */
public class ActivationMailer extends BaseMailer {

	static final String _from = "nomi_and_assaf@egreeting.edu";
	static final String _subject = "E-Greeting: E-Mail Activation";
	public static final String _emailAddrParamName = "emailAddr";
	
	public ActivationMailer(String recipientEmail) {
		super(_from, recipientEmail);
	}
	
	/**
	 * buildMessageBody
	 * 
	 * this function create the activation mail body.
	 * 
	 * @param activationURL - referring servlet url that will handle the activation
	 * @return email body string
	 */
	public String buildMessageBody(String activationURL)
	{
		String message = "Hi, <br/> This is an activation mail from E-Greeting.<br/><br/>" +
				"In order to activate your E-Mail, please <a href=\"";
		message = message + activationURL + "?" + _emailAddrParamName + "=" + get_recipientEmail();
		message = message + "\">click here to activate your E-Mail</a>.<br/><br/>Thanks,<br/>Nomi & Assaf";
		return message;
	}

	/*@
	 * (non-Javadoc)
	 * @see edu.intprog.mail.BaseMailer#get_subject()
	 */
	public String get_subject() {
		return _subject;
	}
}
